<template>
  <div>
    <user-card-list :user-list="userList" :loading="false" :isShowButton="false"/>
    <van-empty v-if="!userList || userList.length<1" description="数据为空"/>
  </div>
</template>

<script setup lang="ts">
import {onMounted, ref} from "vue";
import myAxios from "../request/myAxios";
import UserCardList from "../components/UserCardList.vue"

const userList = ref([])
const listUser = async () => {
  let userDataList = []
  userDataList = await myAxios.get('/user/follow').then(res => {
    return res?.data.data
  })
  if (userDataList) {
    userDataList.forEach(user => {
      if (user.tags) {
        user.tags = JSON.parse(user.tags);
      }
    })
    userList.value = userDataList;
  }
}
//页面加载时触发一次
onMounted(()=>{
  listUser()
})
</script>

<style scoped>

</style>
